package com.wnxy.mapper;

import com.wnxy.bean.Color;
import com.wnxy.bean.Goods;
import com.wnxy.bean.Version;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Goods record);

    Goods selectByPrimaryKey(Integer id);

    List<Goods> selectAll();

    int updateByPrimaryKey(Goods record);

    @Select("select  c.* from  color as c inner join goodscolor as gc where gc.color_id=c.id and gc.goods_id=#{id}")
    List<Color>  selectGoodsColor(@Param("id") int id);

    @Select("select * from version as v inner join versiongoods as vg on vg.version_id=v.id and goods_id=#{id}")
    List<Version> selectGoodsVersion(@Param("id") int id);
}